/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.diplomka.servicelayer.gamelogic.manager;

import cz.muni.fi.diplomka.servicelayer.dto.Alliance;
import cz.muni.fi.diplomka.servicelayer.dto.AllianceMember;
import java.util.List;

/**
 * Interface for manipulating with Alliance and Player in them
 *
 * @author Jakub Kutil
 */
public interface AlliancesManager {

    /**
     * Creates new Allince
     *
     * @param alliance Alliance to create
     *
     */
    public void createAlliance(Alliance alliance);

    /**
     * Edits Alliance
     *
     * @param alliance Alliance to edit
     */
    public void editAlliance(Alliance alliance);

    /**
     * Deletes Allince
     *
     * @param allianceId Id of Alliance to delete
     */
    public void deleteAlliance(Long allianceId);

    /**
     * Gets Member of specified Alliance
     *
     * @param allianceId Id of specified Alliance
     * @return list of Member of Alliance
     */
    public List<AllianceMember> getMembersOfAlliance(Long allianceId);

    /**
     * Gets all Alliance
     *
     * @return list of all Alliance
     */
    public List<Alliance> getAllAlliances();

    /**
     * Gets Alliance with specified name
     *
     * @param name
     * @return found Alliance or empty one if not found
     */
    public Alliance getAllianceByName(String name);

    /**
     * Puts Player into Alliance
     *
     * @param playerId Id of Player to add
     * @param allianceId Id of Alliance to add to
     */
    public void joinAlliance(Long playerId, Long allianceId);

    /**
     * Removes Player from Alliance
     *
     * @param playerId Id of Player to remove from Alliance
     */
    public void leaveAlliance(Long playerId);

    /**
     * Gets Alliance to which Player belongs
     *
     * @param playerId Id of Player
     * @return found Alliance or empty one if not
     */
    public Alliance getAllianceOfPlayer(Long playerId);
}
